﻿using Microsoft.AspNetCore.Mvc.ModelBinding;

namespace RemoteSensingImageDirectServer.Register.Http
{
    public class CsvArrayModelBinderProvider : IModelBinderProvider
    {
        public IModelBinder GetBinder(ModelBinderProviderContext context)
        {
            // 当模型类型为 int[] 时，返回 CsvArrayModelBinder
            if (context.Metadata.ModelType == typeof(int[]))
            {
                return new CsvArrayIntModelBinder();
            }
            else if (context.Metadata.ModelType == typeof(double[])) { 
                return new CsvArrayDoubleModelBinder();
            }
            return null;
        }
    }
}
